<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container" id="app">
    <div class="layuimini-main">
        <fieldset class="table-search-fieldset">
            <legend>角色任务日志</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" name="search" lay-filter="table-search" id="search">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">选择区服:</label>
                            <div class="layui-input-inline">
                                <select name="gameArea" class="layui-select">
                                    <option v-for="(item,index) in services" :value="item.server_id" :selected="index==0">{{item.name}}</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">账号ID:</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="memId" />
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">角色ID:</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="roleId" />
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">角色名:</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="nick" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn">
                                <i class="layui-icon"></i> 搜 索</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>
      <!--  <script type="text/html" id="topToolBar">
            <div class="layui-btn-container">
            </div>
        </script>-->


        <table class="layui-hide" id="current-table" lay-filter="current-table"></table>
        <script type="text/html" id="currentTableBar">
        </script>
    </div>
</div>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/js/common.js?v=5" charset="utf-8"></script>
<script>
var mapList = getEnum('map');
var equipments = getEnum('equip')
function getEquipName(itemId) {
    for(var k in equipments){
        if (equipments[k].id === itemId){
            return equipments[k].name;
        }
    }
    return itemId;
}
new Vue({
    el: "#search",
    data: {
        services: JSON.parse(localStorage.getItem('services')),
        mapList:mapList,
    },
    created() {

    },
    updated() {

    },
    mounted() {

        layui.use(['form', 'table'], function () {
            var $ = layui.jquery,
                form = layui.form,
                table = layui.table;
            table.render({
                elem: '#current-table',
                url: "/admin/LogRoleGITask/paginate",
                where:form.val("table-search"),
                toolbar: '#topToolBar',
                defaultToolbar: ['filter'],
                cols: [[

                    {field: "logTime", title: "日志生成时间",templet(row){
                            return getYMDHMS(row.logTime)
                        }},
                    {field: "gameArea", title: "所在服务器ID"},
                    {field: "memId", title: "账号ID"},
                    {field: "action_type", title: "操作类型"},
                    {field: "roleId", title: "角色ID"},
                    {field: "nick", title: "角色昵称"},
                    {field: "task_id", title: "任务ID"},
                    {field: "task_type", title: "任务类型"},
            ]
                ],
                limits: [10, 15, 20, 25, 50, 100],
                limit: 15,
                page: true,
                skin: 'line'
            });
            form.on('submit(data-search-btn)', function (data) {
                var searchData = data.field;
                //执行搜索重载
                table.reload('current-table', {
                    page: { curr : 1 }
                    , where:searchData
                }, 'data');
                return false;
            });

            //格式化处理函数
            function datafromatType(row) {
                //定义一组数组定义显示
                var vulues=[
                    (   { value: 1, title: '玩家' },
                        { value: 0, title: 'NPC' })
                    ];

            }


        });
    }
})
</script>
</body>
</html>
